function hooverindex = hoover(y)
% This function calculates the Hoover index over identically-distributed
% (equally-weighted) individuals
% See http://en.wikipedia.org/wiki/Hoover_Index

meany=mean(y);

absdevy=abs(y-meany);

hooverindex=0.5*sum(absdevy)/sum(y);
end

